<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
</head>

<body>
  <div class="topic-wrapper">
    <div class="weui-cell weui-cell_access flex-justify-space-between">
      <div class="weui-cell___bd">
        <input class="weui-input select-item" type="tel" placeholder="投票标题(必填)">
      </div>
      <div class="weui-cell__ft checkbox-box">
        <input type="text" class="checkbox-s" placeholder="1" />
      </div>
    </div>
    <div class="select-group-item">
      <div class="weui-cell">
        <div class="weui-cell__hd"></div>
        <div class="weui-cell__bd">
          <i class="weui-icon-reduce"></i><input class="weui-input select-item" type="text" placeholder="选项">
        </div>
      </div>
      <div class="weui-cell">
        <div class="weui-cell__hd"></div>
        <div class="weui-cell__bd">
          <i class="weui-icon-reduce"></i><input class="weui-input select-item" type="text" placeholder="选项">
        </div>
      </div>
    </div>
    <a href="javascript:void(0);" class="weui-cell weui-cell_link">
      <div class="weui-cell__bd add-select-item">
        <i class="weui-icon-addition"></i>
        <p class="p_add-select-item">添加选项</p>
      </div>
    </a>
    <div class="weui-cells__title delete-topic"><span class="close">+</span>删除本题</div>
  </div>
  <script>
    window.onload = function () {

      var startTime = "2018-09-17 18:06:23";

      // 倒计时
      var t = 20 * 60 * 1000; //20分钟毫秒
      var intDiff = parseInt(t / 1000);
      console.log(intDiff)

      function timer(intDiff) {
        window.setInterval(function () {
          var minute = intDiff / (60 * 1000),
            second = intDiff / (60 * 60 * 1000); //时间默认值       
          if (intDiff > 0) {
            minute = Math.floor(intDiff / 60);
            second = Math.floor(intDiff) - (minute * 60);
          } else {
            console.log('完成');
            return;
          }
          if (minute <= 9) minute = '0' + minute;
          if (second <= 9) second = '0' + second;
          $('.min').html(minute);
          $('.sec').html(second);
          intDiff--;
        }, 1000);
      }
      timer(intDiff);
    }
  </script>
</body>

</html>